package cn.sangyy.gift.controller;

import cn.sangyy.gift.common.util.AjaxResult;
import cn.sangyy.gift.common.util.PageList;
import cn.sangyy.gift.doc.SpuGiftDoc;
import cn.sangyy.gift.query.SpuGiftQuery;
import cn.sangyy.gift.service.ISpuGiftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author SangYY
 * @date: 2023/04/08/14:27
 */
@RequestMapping("/search")
@RestController
public class SpuGiftController {

    @Autowired
    private ISpuGiftService spuGiftService;

    @PostMapping("/queryList")
    public AjaxResult querySearch(@RequestBody SpuGiftQuery query){
        PageList<SpuGiftDoc> pageList = spuGiftService.search(query);
        return AjaxResult.me().setResultObj(pageList);
    }
}
